package cn.winwintech.Incense.dao;

import java.util.List;

import com.base.webapp.respm.ResException;

import cn.winwintech.Incense.model.Operation;
import cn.winwintech.Incense.model.User;

public interface UserDao extends GenericDao {

	public static final long TOKEN_EXPIRE_TIME = 7 * 24 * 60 * 60 * 1000;

	public User findUserById(long id);

	public User findUserByTokenNotNull(String token) throws ResException;

	public User findUserByToken(String token);

	public User findUserByPhone(String phone);

	public String refreshToken(User user);

	public boolean isPhoneExist(String phone);

	public User createUser(String name, String phone, String password, String avatar);

	public Operation findOperationById(long id);

	public List<Operation> findOperationList(int page, long maxUpdateAt);

	public int findTotalNum(long maxUpdateAt);

}
